<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/11/24 0024
  Time: 14:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"  isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
</head>
<script src="js/jquery-2.2.3.min.js"></script>
<script type="text/javascript">
    $(function(){
        $("#openservlet").click(function (){
            $.ajax({
                url:"account/openservlet",
                type:"get",
                data: {"id":"1","name": "aff","money":200},
                dataType:"json",
                success:function (data){
                    alert(data.id)
                },
                error:function (data){
                    alert("错误")
                }
            })
        })
        $("#closeservlet").click(function (){
            $.ajax({
                url:"account/closerservlet",
                type:"get",
                success:function (data){
                    alert(data)
                },
                error:function (data){
                    alert("错误")
                }
            })
        })
        $("#test").click(function (){
            $.ajax({
                url:"account/test",
                type:"get",
                success:function (data){
                    $("#test").html(data);
                },
                error:function (data){
                    alert("错误")
                }
            })
        })
    })
</script>
<body>
<h2>你好</h2>
<a href="account/findall">查找</a><br>
<button id="openservlet" >打开服务器</button><br>
<button id="closeservlet" >关闭服务器</button><br>
<button onclick="alert('asffas')">saf</button><br>
<a href="page/success.jsp">测试</a>
<form action="account/save" method="post">
    姓名：<input type="text" name="name"><br>
    钱：<input type="text" name="money"><br>
    <input type="submit">
</form>
<div id="test"><button>按钮</button></div>
</body>
</html>
